'''
作业
'''
# 1. 统计某个元素在列表中出现的次数
nums = [1, 2, 3, 6, 2, 2, 6, 8, 3]
num = 2
count = 0
for i in nums:
    if i == num:
        count += 1
print('{}出现的次数{}'.format(num, count))
# 2. extend
nums = [1, 2, 3, 6, 2, 2, 6, 8, 3]
extend = [12, 69, 35]
for i in extend:
    nums.append(i)
print(nums)

# 3. index
nums = [1, 2, 3, 6, 2, 2, 6, 8, 3]
num = 8
index = -1
for i in nums:
    index += 1
    if i == num:
        break
print(index)
# 4. reverse
nums = [1, 5, 3,4]
count = 0
for i in nums[-1:-len(nums): -1]:
    nums.insert(count, i)
    nums.pop()
    count += 1
print(nums)
